package com.goodving.guli.bt.profile.scale;

import android.bluetooth.BluetoothDevice;

import com.goodving.guli.view.C3657a;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.UUID;

/**
 * Created by Administrator on 2015/11/25 0025.
 */
public class C3907e {
    public BluetoothDevice btDev;
    public int rssi;
    public byte flags; //f19694c;
    public ArrayList<String> serv16; // f19695d;
    public ArrayList<String> inServ16; // f19696e;
    public ArrayList<String> serv128; // f19697f;
    public ArrayList<String> inServ128; // f19698g;
    public String solicit16;
    public String solicit128;
    public String localName;
    public String shortLocalName;
    public String txLevel;
    public String manufact;
    public ScaleWeightInfo scaleWeightInfo;
    public String other;
    public String devMacAddr;
    public int deviceType; // to identify the manufacture information by parsing.


    public C3907e() {
        this.btDev = null;
        this.rssi = 0;
        this.flags = (byte) 0;
        this.serv16 = new ArrayList();
        this.inServ16 = new ArrayList();
        this.serv128 = new ArrayList();
        this.inServ128 = new ArrayList();
        this.solicit16 = C3657a.f18328f;
        this.solicit128 = C3657a.f18328f;
        this.localName = C3657a.f18328f;
        this.shortLocalName = C3657a.f18328f;
        this.txLevel = C3657a.f18328f;
        this.manufact = C3657a.f18328f;
        this.scaleWeightInfo = new ScaleWeightInfo();
        this.other = C3657a.f18328f;
        this.deviceType = 0;
    }

    public boolean m25433a() {
        return (this.flags & 1) == 1;
    }

    public boolean m25434a(UUID uuid) {
        Iterator it = this.serv16.iterator();
        while (it.hasNext()) {
            if (GattUtils.m25322a((String) it.next()).equals(uuid)) {
                return true;
            }
        }
        it = this.inServ16.iterator();
        while (it.hasNext()) {
            if (GattUtils.m25322a((String) it.next()).equals(uuid)) {
                return true;
            }
        }
        it = this.serv128.iterator();
        while (it.hasNext()) {
            if (GattUtils.m25336b((String) it.next()).equals(uuid)) {
                return true;
            }
        }
        it = this.inServ128.iterator();
        while (it.hasNext()) {
            if (GattUtils.m25336b((String) it.next()).equals(uuid)) {
                return true;
            }
        }
        return false;
    }

    public boolean m25435b() {
        return ((this.flags >> 1) & 1) == 1;
    }

    public boolean m25436c() {
        return ((this.flags >> 2) & 1) == 1;
    }

//    @Override
//    public String toString() {
//        return "[" + this.btDev.getName() + this.btDev.getAddress() + "] " + "flag:" + this.f19694c + ",serv16:" + this.f19695d + ",inServ16:" + this.f19696e + ",serv128:" + this.f19697f + ",inServ128:" + this.f19698g + ",solicit16:" + this.solicit16 + ",solicit128:" + this.solicit128 + ",localName:" + this.localName + ",shortLocalName:" + this.shortLocalName + ",txLevel:" + this.txLevel + ",manufact:" + this.manufact + ",weightData:" + this.scaleWeightInfo + ",other:" + this.other;
//    }
}

